library NanosteelNet initializer init requires LegacySystem


	private function NanosteelNetConditions takes nothing returns boolean
		local integer i = GetSpellAbilityId()
		return i=='A03W' or i=='A068' or i=='A076'
	endfunction

	private function NanosteelNet takes nothing returns nothing
		local unit u = GetSpellTargetUnit()
		call TriggerSleepAction(0)
		call UnitAddAbility(u,'A02Q')
		call ShiftMoveSpeed(u,-25.0)
		call PolledWait(5.)
		if GetWidgetLife(u)>0.405 then
			call UnitRemoveAbility(u,'A02Q')
			call ShiftMoveSpeed(u,25.0)
		endif
		if u!=null then
			set u = null
		endif
	endfunction

	private function init takes nothing returns nothing
		local trigger t
		set t = CreateTrigger()
		call TriggerRegisterAnyUnitEventBJ( t, EVENT_PLAYER_UNIT_SPELL_EFFECT  )
		call TriggerAddCondition( t, Condition( function NanosteelNetConditions ) )
		call TriggerAddAction(t,function NanosteelNet)
	endfunction

endlibrary